const p: ParagrahBuilder = Object.assign(
  (...data: any[]): string[] => {
    if (Array.isArray(data[0])) {
      return paragrah1(data[0], data[1])
    } else {
      return paragrah1(data)
    }
  },
  { indent: 2 },
)

function paragrah1(data: string[], indent = 1) {
  const indentStr = ' '.repeat(p.indent * indent)
  return data.map(d => indentStr + d)
}

interface ParagrahBuilder {
  (data: string[], indent?: number): string[]
  (...data: string[]): string[]
  indent: number
}

export { p }
